define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.deal_log/index',
        add_url: 'mall.deal_log/add',
        edit_url: 'mall.deal_log/edit',
        delete_url: 'mall.deal_log/delete',
        export_url: 'mall.deal_log/export',
        modify_url: 'mall.deal_log/modify',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},                    {field: 'id', title: 'id'},                    {field: 'appid', title: 'appid'},                    {field: 'deal_type', search: 'select', selectList: notes?.deal_type || {}, title: '交易类型'},                    {field: 'sys_number', title: '交易单号'},                    {field: 'deal_money', title: '交易金额，单位：分'},                    {field: 'deal_balance', title: '余额'},                    {field: 'deal_type_str', title: '交易类型说明'},                    {field: 'remark', title: '备注', templet: ea.table.text},                    {field: 'create_time', search: 'range', title: '创建时间'},                    {field: 'update_time', search: 'range', title: '更新时间'},                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
});